package initter

import (
	"MxShop/global"
	"fmt"
	"github.com/hashicorp/consul/api"
)

func InitConsuleConfig() {
	config := api.DefaultConfig()
	config.Address = fmt.Sprintf("%s:%d", global.ServerConfig.Consule.Host, global.ServerConfig.Consule.Port)
	consuleClient, err := api.NewClient(config)
	if err != nil {
		panic(err)
	}
	global.ConsuleClient = consuleClient
}
